# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1313013910.581133
_template_filename='/home/pylonsapp/readthematrix/trunk/portal/portal/templates/chat/index.mako'
_template_uri='/chat/index.mako'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['title']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    pass
def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/index.mako', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        p = context.get('p', UNDEFINED)
        str = context.get('str', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n')
        # SOURCE LINE 2
        __M_writer(u'\n')
        # SOURCE LINE 3

        
        def message(messages):
                p = ""
                if messages:
                        for message in messages:
                                p = p + "<p>[%s] %s:%s<p>" % ( message.when_created, message.last_name, message.message)
                else:
                        p = "<span id='no-message'>Aucun Messages</span>" 
                return str(p )  
        
        
        __M_locals_builtin_stored = __M_locals_builtin()
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['message'] if __M_key in __M_locals_builtin_stored]))
        # SOURCE LINE 13
        __M_writer(u'\n\n<div id="chat_window" OnUnload="alert(\'toto\');">\n\t<p>Welcome on the Chat</p>\n\t<p style="font-size: 12px;">Personne(s) Connect\xe9e(s): <span id="chat_who_is_online"></span></p>\n\t<div id="chat_message_windows">\n\t\t<div id="chat_message_list">\n\t\t\t\n\t\t</div>\n\t\t\n\t\t<form id="chat_submit_form" ">\n\t\t\t<input id="chat-message" type="text" name="message" size="200" />\n\t\t\t<input id="chat-send-message" type="submit" value="Envoyer" OnClick="return false;" />\n\t\t</form>\n\t</div>\n\t\n</div>\n\n<script type="text/javascript">\n\n$(document).ready(function() {\n\tif($.browser.mozilla){\n\t\t$(window).unload(function() {\n\t\t\t\n\t\t\ti_am_leaving_chat(us_id);\t  \n\t\t});\n\t\t$(window).load(function() {\n\t\t\ti_am_entering_chat(us_id);  \n\t\t})\n\t\trezise_chat();\n\t\tcheck_who_is_online();\n\t\tscan_for_new_messages();\n\t\tchat_auto_scroll_down();\n\t\t$(\'#chat-message\').focus();\n\t\t$(\'#chat-send-message\').click(function(){\n\t\t\tvar message = $(\'#chat-message\').val();\n\t\t\tif($.trim(message) == \'\'){\n\t\t\t\talert(\'Le message est vide !\');\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\tadd_new_messages(message, us_id);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\n\t}else{\n\t\talert(\'Chat disponible seulement pour Firefox\');\n\t\t$(\'#chat_message_list\').append(\'<span style="color: red; font-weight: bold; font-size: 18px;">Chat disponible seulement pour Firefox</span>\');\n\t}\n});\n</script>')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_title(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 2
        __M_writer(u'Home - Welcome')
        return ''
    finally:
        context.caller_stack._pop_frame()


